package com.xyy.saas.payment.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author wangzeqi
 */
@AllArgsConstructor
@Getter
public enum ReconciliationType {

    TRADE_DETAIL("交易明细对账"),
    FUND_ACCOUNT("资金账户对账"),
    RECHARGE("购物金充值对账"),
    REFUND_ADVANCE("退款垫资对账"),
    CHANNEL_COLLECTION("渠道收款对账"),
    ;

    private final String description;

    public static ReconciliationType getByName(String name) {
        if (name == null) {
            return null;
        }

        String upperName = name.toUpperCase();
        for (ReconciliationType type : values()) {
            if (type.name().equals(upperName)) {
                return type;
            }
        }
        return null;
    }

}
